var myApp = angular.module('myApp', []);

myApp.controller('CounterController', ['$scope', function($scope){
	$scope.decrement = function() {
		$scope.count = $scope.count - 1;
	};
}]);

myApp.controller('CityController', ['$scope', function($scope){
	$scope.cities = [
		{name : 'Seattle'},
		{name : 'San Francisso'},
		{name : 'Chicago'},
		{name : 'New York'},
		{name : 'Boston'}
	];
}]);

myApp.controller('FormController', ['$scope', function($scope){
	$scope.person = {name : null};
	$scope.people = [];
	$scope.submit = function() {
		if ($scope.person.name) {
			$scope.people.push({name : $scope.person.name});
			$scope.person.name = '';
		}
	};
}])

myApp.controller('LotteryController', ['$scope', function($scope){
	$scope.generateNumber = function() {
		return Math.floor((Math.random()*10) + 1);
	}
}]);